package com.zhangyu.shadow.repair.delegate.search;

import com.zhangyu.shadow.repair.base.IStringDataConvert;
import com.zhangyu.shadow.repair.delegate.bean.BusBean;
import com.zhangyu.shadow.repair.delegate.bean.BusTypeBean;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.disposables.Disposable;
import st.lib.base.delegate.mvp.BaseModel;
import st.lib.base.delegate.mvp.BasePresenter;
import st.lib.base.delegate.mvp.BaseView;
import st.lib.base.net.callback.IError;
import st.lib.base.ui.recycler.MultipleItemEntity;

/**
 * Description:
 *
 * @author Hequn.Lee
 * @date 2018/11/7
 */
public interface SearchBusContract {

    interface View extends BaseView {

        void getBusListSuccess(List<BusTypeBean> list);

        void getBusListFailed(int code, String msg);

        void searchCodeSuccess(ArrayList<MultipleItemEntity> list);

        void searchCodeFailed(int code, String msg);

        void searchBusSuccess(ArrayList<MultipleItemEntity> list);

        void searchBusFailed(int code, String msg);

        void showDialogProgress();

        void closeDialogProgress();
    }

    interface Model extends BaseModel {
        Disposable searchBus(String code,
                             IStringDataConvert<ArrayList<MultipleItemEntity>> success,
                             IError error);

        Disposable searchCode(String code,
                              IStringDataConvert<ArrayList<MultipleItemEntity>> success,
                              IError error);

        Disposable getBusList(
                String depId,
//                String groupId,
                String dateStart, String dateEnd,
                IStringDataConvert<ArrayList<BusBean>> success,
                IError error);
    }

    abstract class Presenter extends BasePresenter {
        abstract void searchBus(String code);

        abstract void searchCode(String code);

        abstract void getBusList(String dateStart,
                                 String dateEnd,
                                 String depId);
//                               String key,  String groupId,

    }
}
